package com.klhappy.houyuan.dialog;

import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.klhappy.houyuan.R;
import com.klhappy.houyuan.activity.ConfirmMoneyActivity;
import com.klhappy.houyuan.utils.NotifyMethod;

import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.OnClick;

/**
 * Created by MrPu on 15/12/29.
 */
public class ConfirmMoneyDialog {
    private Dialog dialog;

    @InjectView(R.id.tv_content)
    TextView tv_content;
    @InjectView(R.id.et_password)
    EditText et_password;

    @OnClick(R.id.btn_canncl)
    public void btn_canncl(){
        dialog.dismiss();
    }

    @OnClick(R.id.btn_get)
    public void btn_get(){
        String password = et_password.getText().toString();
        NotifyMethod.getInstance().postNotification(ConfirmMoneyActivity.AVD ,password);
    }

    public void setDialog(Context context ,String money ,String acount) {
        View view = LayoutInflater.from(context).inflate(R.layout.dialog_confirm_money ,null);
        ButterKnife.inject(this ,view);

        tv_content.setText("    您将要提现" + money + "元到您的支付宝账号" + acount + ",请输入提现密码:");

        dialog = new Dialog(context ,R.style.Dialog_Fullscreen);
        dialog.setContentView(view);
    }

    public void Show(){
        dialog.show();
    }
    public void Dismiss(){
        if (dialog.isShowing()){
            dialog.dismiss();
        }
    }
}
